/**
 * Created by hiephn on 2014/08/26.
 */
define('shell', ['durandal/app', 'knockout', 'plugins/router', 'jquery', 'theme'], function (app, ko, router, $, theme) {
    var koo = ko.observable;

    return {
        hasHeader: koo(true),
        hasSidebar: koo(true),
        user: app.user(),
        activate: function() {
            window.router = router;
            router.map([
                { route: ['', '_=_', 'home'], title:'Home', moduleId: 'home/index', nav: true },
                { route: 'login', title:'Login', moduleId: 'login/index', nav: true },
                { route: 'channel-select', title:'Channel Select', moduleId: 'channel-select/index', nav: true }
            ]).buildNavigationModel();

            return router.activate();
        },
        attached: function() {
            theme.init();
        }
    };
});
